<%@ page import="message.testBean1"%>
<%@ page import="message.LoginBean"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="javax.swing.JOptionPane"%>
<%@ page import="java.io.Serializable"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<meta charset="UTF-8">
		<title>住宿要求</title>
		<link rel="stylesheet" href="css/public.css" />
		<link rel="stylesheet" href="css/testQuestion.css" />
		<script type="text/javascript" src="js/jquery-1.11.0.js" ></script>
		<script type="text/javascript" src="js/style.js"></script>
	</head>
 	<%
  		String name=null;
  		String id=null;
  		String password=null;
  		String className=null;
  		ArrayList login=(ArrayList)session.getAttribute("login");
  		if(login==null||login.size()==0){name="请登录";}
  		else{
	  		for(int i=login.size()-1;i>=0;i--){
		  		LoginBean bean=(LoginBean)login.get(i);
		  		id=bean.getAccount();
		  		password=bean.getPassword();
		  		name=bean.getName();
		  		className=bean.getClassName();
	  		}
	  	}
  	%>
	<body>
		<div id="head" class="gradient clear">
			<div class="fl" id="log">
				<a id="logo" href="index.jsp"></a>
			</div>
			<div class="head_message fr" id="head_message">
				<span>欢迎您： <a href="login.jsp"><%=name%></a> 同学</span>
			</div>
		</div>
		
		<div id="body">	
			<h1>大学生气质类型测试</h1>
			<form id="temperature" name="temperature" action="${pageContext.request.contextPath}/temperatureServlet" method="post" onsubmit="return checktext(this);">
			<input class="ipt content none" name="student_name" id="student_name" readOnly="readOnly"  value="<%=name%>"/>
			<input class="ipt content none" name="student_id" id="student_id" readOnly="readOnly"  value="<%=id%>"/>
			<input class="ipt content none" name="student_className" id="student_className" readOnly="readOnly"  value="<%=className%>"/>
			<input class="ipt content none" type="password" name="student_password" id="student_password" value="<%=password%>">
		  	<%
		  		String question=null;
		  		int count=0;
		  		ArrayList QList=(ArrayList)session.getAttribute("QList");
		  		if(QList==null||QList.size()==0){question=null;}
		  		else{
			  		for(int i=0;i<QList.size();i++){
				  		testBean1 tq=(testBean1)QList.get(i);
				  		question=tq.getQuestion();
				  		count=tq.getCount();
		  	%>
				<div class="info_clear clear">
		            <span class="label-name" >Q<%=count%>、<%=question%></span>
		            <div class="info_left">
		                <label class="label" for="<%=count%>_1">
							<input type="radio" class="radio"  name="<%=count%>" value="2" id="<%=count%>_1"/>
		        			<span>完全符合</span>
						</label>
						<label class="label" for="<%=count%>_2">
							<input type="radio" class="radio" name="<%=count%>" value="1" id="<%=count%>_2"/>
		        			<span>比较符合</span>
						</label>
						<label class="label" for="<%=count%>_3">
							<input type="radio" class="radio"  name="<%=count%>" value="0" id="<%=count%>_3"/>
		        			<span>一般</span>
						</label>
						<label class="label" for="<%=count%>_4">
							<input type="radio" class="radio" name="<%=count%>" value="-1" id="<%=count%>_4"/>
		        			<span>比较不符合</span>
						</label>
						<label class="label" for="<%=count%>_5">
							<input type="radio" class="radio" name="<%=count%>" value="-2" id="<%=count%>_5"/>
		        			<span>完全不符合</span>
						</label>
		            </div>
		       </div>
		  	<%
			  		}
			%>
			  	<input class="ipt content none" type="text" name="temp_size" id="temp_size" value="<%=QList.size()%>">
			<%
			  	}
		  	%>
				<div class="info_clear clear">
					<input type="submit" class="btn" id="enter" value="提交"/>
				</div>
			</form>
		</div>
	</body>
</html>
